﻿using System.Data.Entity;
using Turquoise.Providers.EntityFramework.Abstract;
using Turquoise.Providers.EntityFramework.Mappings;

namespace Turquoise.Providers.EntityFramework
{
    public class DatabaseContext : DbContext, IDatabaseContext
    {
        public IDbSet<T> Set<T>() where T : class
        {
            return base.Set<T>();
        }

        static DatabaseContext()
        {
            Database.SetInitializer<DatabaseContext>(null);
        }

        public DatabaseContext() : base("Name=DatabaseProviderContext")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new LanguageMapping());
        }
    }
}
